package org.yray.sip.time;


import lombok.Data;
import org.yray.sip.factory.SipSessionFactory;
import org.yray.sip.rtp.sender.ISipSessionCache;
import org.yray.sip.server.SipSession;
import org.yray.sip.utils.IcspBeanHolder;

import java.util.Optional;

@Data
public class OffPauseSendTask extends BaseSendTask {

    private String callId;


    public OffPauseSendTask(long time, String callId)
    {
        this.time=time;
        this.callId=callId;

    }
    @Override
    public void doJob() {
        SipSession sipSession= IcspBeanHolder.getBean(ISipSessionCache.class).get(callId);
        Optional.ofNullable(sipSession).ifPresent(v -> {
            //IcspBeanHolder.getBean(SipSessionFactory.class).pauseOnOff(v,false);

        });
    }
}
